//
//  LoopLocationView.swift
//  LoopWeibo
//
//  Created by loop安 on 2016/12/17.
//  Copyright © 2016年 loop. All rights reserved.
//

import UIKit

class LoopLocationView: UIView {
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI(){
        self.backgroundColor = UIColor.white
        
        addSubview(positionBtn)
        addSubview(publicBtn)
        addSubview(lblCount)
        
        positionBtn.snp.makeConstraints { (make) in
            make.leading.equalTo(self).offset(5)
            make.centerY.equalTo(self)
            make.height.equalTo(20)
            make.width.equalTo(100)
        }
        
        publicBtn.snp.makeConstraints { (make) in
            make.trailing.equalTo(self).offset(-5)
            make.centerY.equalTo(self)
            make.width.equalTo(60)
            make.height.equalTo(20)
        }
        
        lblCount.snp.makeConstraints { (make) in
            make.trailing.equalTo(publicBtn.snp.leading).offset(-5)
            make.centerY.equalTo(publicBtn)
        }


    }
    
    lazy var positionBtn:UIButton = {
        
        let position = UIButton()
        position.setImage(#imageLiteral(resourceName: "compose_locatebutton_ready"), for: .normal)
        position.setTitle("Your position", for: .normal)
        position.setTitleColor(UIColor.lightGray, for: .normal)
        position.titleLabel?.font = UIFont.systemFont(ofSize: 11)
        position.setBackgroundImage(#imageLiteral(resourceName: "compose_location_button_background"), for: .normal)
        //        position.layer.cornerRadius = 10
        //        position.clipsToBounds = true
        return position
    }()
    
    lazy var publicBtn:UIButton = {
        
        let publicBtn = UIButton()
        publicBtn.setImage(#imageLiteral(resourceName: "compose_publicbutton"), for: .normal)
        publicBtn.setTitle("Public", for: .normal)
        publicBtn.setTitleColor(UIColor.blue, for: .normal)
        publicBtn.titleLabel?.font = UIFont.systemFont(ofSize: 11)
        //        publicBtn.backgroundColor = UIColor(white: 0.9, alpha: 1)
        publicBtn.setBackgroundImage(#imageLiteral(resourceName: "compose_location_button_background"), for: .normal)
        return publicBtn
    }()
    
    lazy var lblCount:UILabel = {
        
        let lbl = UILabel()
        lbl.textAlignment = .center
        lbl.font = UIFont.systemFont(ofSize: 11)
        lbl.isHidden = false
        return lbl
    }()

}
